#ifndef _PERSEUS_H__
#define _PERSEUS_H__

#include <stdlib.h>
#include <math.h>
#include <stdio.h>

#define KMAX_GEN 6
#define KMIN_GEN 2
#define NMAX_GEN 5
#define NMIN_GEN 6
#define MAX_CONT 15 
#define MIN_CONT 10

#define MIN_MATWIDTH 6 
#define MAX_MATWIDTH 16

/*Fonction alea() : a random float between 0 and 1 */
#define alea() \
  (rand()/(RAND_MAX + 1.0))


int nothing(FILE * file, char * format, ...);
/*#ifdef DEBUG*/
#define perseusLOG fprintf 
/*#else  
#define perseusLOG nothing 
#endif
*/

typedef struct pcc_t 
{
    unsigned int mN;
    unsigned int mK;
    unsigned int mM;
    unsigned long **mPoly;
    unsigned int mMatWidth;
    unsigned char * mMatrix;
    unsigned int mMatDepth;
    unsigned char mNumLine;
    unsigned long long  mX0;
} pcc;

pcc * generateCode(void ); 

unsigned char
pcc_Code(
           pcc *aCode,
           const char * data,
           unsigned long length,
           char ** dataCoded,
           unsigned long * codedLength);


unsigned char
pcc_decode(
           pcc *aCode,
           const char * dataCoded,
           unsigned long length,
           char ** dataDecoded,
           unsigned long * dataLength);
void 
pcc_debug(pcc* acode);

void delete_code(pcc *code);

#endif /*_PERSEUS_H__*/
